<div id="sayMain" class="container-fluid">
    <div class="col-md-6 col-md-offset-1" ng-controller="sayCtrl" id="sayPanel">
        <div class="say-header">
            <span class="glyphicon glyphicon-comment"></span> 发表秘密
        </div>
        <div class="say-body">
            <form ng-submit="form.submit()" class="form-horizontal">
                <div class="form-group">
                    <label for="editor" class="col-md-2 control-label">内容:</label>
                    <div class="col-md-10 editor-box">
                        <!-- 加载编辑器之前的过渡动画 -->
                        <div class="loading">
                            *
                        </div>

                        <textarea id="editor" placeholder="Content here ...." ng-model="form.content"></textarea>
                    </div>
                </div>
                <div class="form-group">
                    <label for="sc" class="col-sm-2 control-label">验证码:</label>
                    <div class="col-sm-10">
                        <input type="text" id="sc" name="sc" ng-model="form.sc" placeholder="为防止机器人，请输入验证码" class="form-control" style="display:inline-block; width: 50%;">
                        <img src="" height="34" onclick="" id="sci" title="点击刷新" />
                    </div>
                </div>
                <div class="form-group">
                    <label for="tags" class="col-sm-2 control-label">标签:</label>
                    <div class="col-sm-10">
                        <input type="text" id="tags" name="tags" ng-model="form.tags" placeholder="标签，多个标签请用空格隔开，可以不填" class="form-control">
                    </div>
                </div>

                <div class="form-group">
                    <div class="col-md-offset-2 col-md-10">
                        <label>
                            <input type="checkbox" name="anonymous" ng-model="form.anonymous"> 匿名发表
                        </label>
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-md-offset-2 col-md-10">
                        <button type="submit" class="btn btn-default">发表</button>
                    </div>
                </div>
            </form>
        </div>
    </div>

    <div id="sayNotice" class="col-md-3">
        <h2>投稿须知</h2>
        <ul>
            <li>请不要包含不友善内容。</li>
            <li>请勿发布广告或留下自己联系方式。</li>
            <li>请至少填写10个字以上。</li>
            <li>编辑器支持Markdown语法，具体格式请参照<a target="_blank" href="http://lab.lepture.com/editor/markdown">Markdown语法说明</a></li>
        </ul>
    </div>
</div>


<script type="text/javascript">
	(function($) {
        setTimeout(function(){
            var editor = new Editor();
            editor.render($('#editor')[0]);
            $('.CodeMirror').eq(0).on('mouseleave', function () {
                $('#editor').val(editor.value());
            });
            $('.loading').fadeOut();
        },800);

        $(document).ready(function () {
            $('#sci').attr('src', '/securityCodeImage?' + Date.now());
        });

        $('#sci').click(function () {
            $(this).attr('src', '/securityCodeImage?' + Date.now());
        });
	})(jQuery);
</script>